***gov win vs gov lose case over time

use HKCFA_u.dta, clear 

keep if gov == 1

sort govlose year

egen c = count(caseno), by(govlose year)
egen a = count(caseno), by(year)

gen rate = c/a

twoway connected rate year if govlose == 0, lpattern(solid solid) ylabel(0(.2)1,nogrid) title("",  position(6)) ytitle(Government Winning Rate) xtitle("") sort graphregion(color(white)) lcolor(navy maroon) mcolor(navy maroon)  xscale(range(1995 2020))

graph export results/govwinrate.pdf, replace
